package com.caocaog.market.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.apache.ibatis.type.JdbcType;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecg.common.handler.ListToStringHandler;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 客户
 *
 * @author jeecg-boot
 * @date 2022-03-09
 */
@Data
@TableName("mk_customer")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "mk_customer对象", description = "客户")
public class Customer implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键")
    private String id;

    @ApiModelProperty(value = "创建人")
    private String createBy;

    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建日期")
    private Date createTime;

    @ApiModelProperty(value = "更新人")
    private String updateBy;

    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新日期")
    private Date updateTime;

    @ApiModelProperty(value = "姓名")
    private String name;

    @ApiModelProperty(value = "手机号")
    private String phone;

    @ApiModelProperty(value = "备注信息")
    private String remark;

    @TableField(jdbcType = JdbcType.VARCHAR, insertStrategy = FieldStrategy.NOT_NULL, typeHandler = ListToStringHandler.class)
    @ApiModelProperty(value = "选择的ids")
    private List<String> checkIds;

    @ApiModelProperty(value = "版本")
    private Integer lockVersion;

    @TableLogic
    @ApiModelProperty(value = "删除标记")
    private Integer delFlag;

    @Dict(dictTable = "mk_area_province",dicCode = "sid" , dicText = "name")
    @ApiModelProperty(value = "省")
    private Integer province;

    @Dict(dictTable = "mk_area_city",dicCode = "sid" , dicText = "name")
    @ApiModelProperty(value = "城市")
    private Integer city;

    @Dict(dictTable = "mk_area_district",dicCode = "sid" , dicText = "name")
    @ApiModelProperty(value = "区县")
    private Integer area;

}
